package com.educhains.module.certification.service.impl;

import com.educhains.module.certification.persist.mybatis.CourseCertificationMapper;
import com.educhains.module.certification.service.CourseCertificationService;
import com.educhains.module.certification.vo.CourseCertification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * User: Devin
 * Date: 2017/11/17
 * Description:
 */
@Service
public class CourseCertificationServiceImpl implements CourseCertificationService {
    @Autowired
    CourseCertificationMapper courseCertificationMapper = null;

    public int certify(CourseCertification courseCertification) {
        return this.courseCertificationMapper.insert(courseCertification);
    }

    public List<CourseCertification> getCertificationByUserId(String userId) {
        return this.courseCertificationMapper.getCertificationByUserId(userId);
    }

    public List<CourseCertification> getCertificationByCourseId(Integer courseId) {
        return this.courseCertificationMapper.getCertificationByCourseId(courseId);
    }

    public CourseCertification getCertificationByFileHash(String fileHash) {
        return this.courseCertificationMapper.getCertificationByFileHash(fileHash);
    }
}
